
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.Logging.Data.Controllers.Interfaces;
using T2.Logging.Data.Entities.Interfaces;
using T2.Logging.Business.Entities.Interfaces;
using T2.Logging.Business.Entities;
using T2.Logging.Business.Translators;


//--Change Management Control - Application Command  --**********************
//--Created By: trooks
//--Description: Application Command Class
//--Created Date: 03/07/2013 10:05:15
//--*************************************************************

namespace T2.Logging.Business.Commands
{
	public partial class Application_Command 
	{
		public IDictionary<string, int> Execute (IApplication_biz _param)
		{
			IDictionary<string, int> r = new Dictionary<string, int>();
			IApplicationController temp = new T2.Logging.Data.Controllers.ApplicationController();
			switch (_param.Action.ToString())
			{
				case "Add":
					r = temp.Application_Add(ApplicationTranslator.TranslateToDataLayer(_param));
					break;

				case "Update":
					r = temp.Application_Modify(ApplicationTranslator.TranslateToDataLayer(_param));
					break;

				case "Remove":
					r = temp.Application_Remove(ApplicationTranslator.TranslateToDataLayer(_param));
					break;

			}
			//var ret = r.ToList().Select(s  => new {Key=s.Key, Value = s.Value}) ;
			//var retVal = ret.Where(z => z.Key == "Return_Value").Select(m => m.Value);
			return r;
		}
	}
}